<%@page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:1px;">
		<t:datagrid name="zyContactsList" fitColumns="false" title="联系人管理" actionUrl="zyContactsController.do?datagrid" idField="id" fit="true" queryMode="group" sortName="cinemaName" sortOrder="desc" autoLoadData="false">
			<t:dgCol title="主键"		field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
			<%--<t:dgCol title="系统用户"	field="tsBaseUser.realName"    queryMode="single"  width="120" sortable="false" />--%>
			<t:dgCol title="联系人类型"  field="type" query="true"   queryMode="single" dictionary="<%=StaticValue.DIC_CONTACT_TYPE %>" width="90"></t:dgCol>
			<%--<t:dgCol title="所属影院"	field="belongCinema.name"    queryMode="single"  width="120" query="true" ></t:dgCol>--%>
			<%--<t:dgCol title="所属机构"	field="belongOrg.shortname"  query="true"  queryMode="single"  width="120" sortable="false" />--%>
			<t:dgCol title="所属影院"	field="cinemaName"    queryMode="single"  width="180" query="true" ></t:dgCol>
			<t:dgCol title="所属机构"	field="belongOrgName"  query="true"  queryMode="single"  width="120" sortable="false" />
			<t:dgCol title="名字"		field="name"  query="true"  queryMode="single"  width="80"></t:dgCol>
			<t:dgCol title="手机1"  field="cellphone1"    query="true" queryMode="single"  width="110"></t:dgCol>
			<t:dgCol title="手机2"  field="cellphone2"    queryMode="single"  width="110"></t:dgCol>
			<t:dgCol title="固话"  field="telephone"   queryMode="single"  width="100"></t:dgCol>
			<t:dgCol title="传真"  field="fax"   queryMode="single"  width="100"></t:dgCol>
			<t:dgCol title="性别"  field="gender"    queryMode="single" dictionary="<%=StaticValue.DIC_SEX %>" width="60"></t:dgCol>
			<t:dgCol title="状态"  field="state"  query="true"  queryMode="single" dictionary="<%=StaticValue.DIC_ENGINEER_STATE %>" width="60"></t:dgCol>
			<t:dgCol title="email"  field="email"    queryMode="single"  width="160"></t:dgCol>
			<t:dgCol title="职位"  field="position"  query="true"  queryMode="single" dictionary="<%=StaticValue.DIC_CONTACT_POSITION %>" width="120"></t:dgCol>
			<t:dgCol title="来源"  field="source"    queryMode="single"  width="100"></t:dgCol>
			<t:dgCol title="用户微信级别"  field="authenticationLevel"  query="true"  queryMode="single" dictionary="<%=StaticValue.WX_LEVEL %>"  width="100"></t:dgCol>
			<t:dgCol title="是否已认证"  hidden="true" field="authentication"    query="false" replace="是_1,否_0" width="80"></t:dgCol>
			<t:dgCol title="联系业务"  field="conBusiness"    queryMode="single" dictionary="<%=StaticValue.DIC_LINK_BUSINESS %>" width="100"></t:dgCol>
			<t:dgCol title="注册影院"  field="zcCinema"    queryMode="single"  width="160"></t:dgCol>
			<t:dgCol title="操作" field="opt" width="100"></t:dgCol>
			<t:dgDelOpt operationCode="ContactsDel"  title="删除" url="zyContactsController.do?dologicDel&id={id}" />
			<t:dgFunOpt title="认证" funname="addGold(id)"/>
			<%--<t:dgDelOpt operationCode="ContactsRz"  title="认证" url="zyContactsController.do?addGold&id={id}" />--%>
			<t:dgToolBar operationCode="ContactsAdd" title="录入" icon="icon-add" width="900" height="320" url="zyContactsController.do?goAdd" funname="add"></t:dgToolBar>
			<t:dgToolBar operationCode="ContactsEdit" title="编辑" icon="icon-edit" width="900" height="320" url="zyContactsController.do?goUpdate" funname="update"></t:dgToolBar>
			<t:dgToolBar operationCode="ContactsSearch" title="查看" icon="icon-search" width="900" height="320" url="zyContactsController.do?goView" funname="goView"></t:dgToolBar>
			<t:dgToolBar operationCode="ContactsPut" title="导入" icon="icon-put" funname="importExcel"></t:dgToolBar>
		</t:datagrid>
	</div>
</div>
<script src = "webpage/com/zybk/zy_contacts/zyContactsList.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        //给时间控件加上样式
        $("#zyContactsListtb").find("input[name='telephone']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
        $("#zyContactsListtb").find("input[name='gender']").attr("class","Wdate").attr("style","height:20px;width:90px;").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
    });
    function goView(title,url,datagridName,width,height){
        var datas = $("#zyContactsList").datagrid("getSelections");
        if(datas.length != 1){
            tip("请选择一项查看");
            return;
        }
        var id = datas[0].id;
        createdetailwindow(title,url+"&id="+id,width,height);
    }
    function importExcel(){
        createdetailwindow('基础数据导入', 'uploadContactsController.do?uploadFile',470,150);
    }

    function addGold(id){
        $.ajax({
            type:"post",
            data:{"id":id},
            dataType:"json",
            url:"zyContactsController.do?addGold",
            success:function(data){
                parent.window.tip(data.msg);
                if(data.obj=='success'){
                    setTimeout(" addOneTab('联系人管理','zyContactsController.do?zyContacts');",1000);
                }
            }
        })

    }
</script>